import java.util.concurrent.TimeUnit;

/**
 * @description: 中线线程正确的解决方法
 * @author: 杨亚旭 89121757@qq.com
 * @create: 2019-03-12 18:38
 **/
public class Interrupted4GoodSolveThread extends Thread{
    public void run(){
        while(true){
            System.out.println("====");
        }
    }

    public static void main(String[] args) throws InterruptedException {
        InterruptedThread thread=new InterruptedThread();
        thread.start();
        System.out.println(thread.isInterrupted());
        thread.interrupt();
        TimeUnit.MILLISECONDS.sleep(50);
        System.out.println(thread.isInterrupted());
    }
}
